package com.mstore.dao;

import java.util.List;

import com.mstore.pojo.SMSLog;

public class SMSLogDao extends SuperDao {

	/**
	 * 
	 * 保存短信发送记录
	 */
	public void save(SMSLog smsLog) {
		super.save(smsLog);
	}

	/**
	 * 
	 * 查询所有短信发送记录
	 */
	public List<Object> watchSMSLog(SMSLog smsLog) {
		String hql = "from SMSLog";
		return super.find(hql);
	}

	/**
	 * 查询全部数据记录数
	 */
	public int getCount() {
		String hql = "Select Count(*) From SMSLog";

		List<Object> list = find(hql);
		Long s = (Long) list.get(0);
		return s.intValue();
	}

	/**
	 * 分页查询短信记录全部数据
	 * 
	 * @param smsLog
	 * @param index
	 */
	public List<Object> getList(SMSLog smsLog, int index) {
		StringBuilder sb = new StringBuilder();
		sb.append("From SMSLog");

		return super.findPage(index, sb.toString());

	}

}
